package com.controller;

import com.constants.Constants;
import com.tools.BaseUntil;
import com.until.TaskManag;
import javafx.fxml.FXML;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.stage.Stage;


public class NewBusyTaskController extends BaseUntil {
    @FXML
    private TextField taskbiaoti;
    @FXML
    private TextArea taskinfo;
    public NewBusyTaskController(){
        //初始化时保存当前Controller实例
        Constants.controllers.put(this.getClass().getSimpleName(), this);
    }
    public void saveTask() {
        String taskbiaotiVar = taskbiaoti.getText();
        String taskinfoVar = taskinfo.getText();
        TaskManag.create(taskbiaotiVar,taskinfoVar,"紧急任务","新建");
        Stage stage = (Stage) taskbiaoti.getScene().getWindow();
        stage.close();
        MainController controller = (MainController) Constants.controllers.get(MainController.class.getSimpleName());
        controller.showList();
    }
}
